#include "gui_base.h"

void gui_img(uint16_t x, uint16_t y, const GUI_IMG *img, uint8_t incolor)
{
	uint16_t i, j, dx;
	uint8_t k;
	
	for(i=0; i<img->high; i++)
	{
		dx = x;
		
		for(j=0; j<img->integer; j++)
		{
			for(k=0; k<8; k++)
			{
				Lcd_DrawPixel(dx, y+i, img->buf[img->interval*i + j] & (0x80>>k), incolor);
				
				dx++;
			}
		}
		
		for(k=0; k<img->remainder; k++)
		{
			Lcd_DrawPixel(dx, y+i, img->buf[img->interval*i + j] & (0x80>>k), incolor);
	
			dx++;
		}
	}
}
